﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Team6_Algorithms.AidingClasses;

namespace Team6_Algorithms.OCR
{
    /// <summary>
    /// Made by Alexander Streng
    /// the class used to Store the line / mask sequences for our algorithm.
    /// </summary>
    [Serializable()]
    public class TestsetCharacter
    {
        public string Name;
        public string Character;
        public string ImgPath;
        public Bitmap Image;
        public PixelPoint[,] Binary;

        public List<int> BottomMask = new List<int>();
        public List<int> RightMask = new List<int>();
        public List<int> LeftMask = new List<int>();
        public List<int> TopmMask = new List<int>();
        public List<int> VerticalSlice = new List<int>();
        public List<int> TopHorizontalSlice = new List<int>();
        public List<int> MidHorizontalSlice = new List<int>();
        public List<int> BottomHorizontalSlice = new List<int>();


        /// <summary>
        /// The constructor
        /// </summary>
        public TestsetCharacter(string path, string name)
        {
            Name = name;
            ImgPath = path;
            Character = Name.Substring(Name.LastIndexOf('_') +1, 1);
            
            
          //  Console.WriteLine("Lezen van " + Name + " Character is " + Character);
        }

        /// <summary>
        /// The Tostring function of the TestSetcharacter
        /// </summary>
        /// <returns>String containing the sequences of the lines and masks</returns>
        public string SequencesToString()
        {
            string returnString = "";

            returnString += "TopSlice: ";
            foreach(int n in TopHorizontalSlice){
                returnString += n + " ";
            }

            returnString += "\n bottomSlice: ";
            foreach (int n in BottomHorizontalSlice)
            {
                returnString += n + " ";
            }

            returnString += "\n verticalSlice: ";
            foreach (int n in VerticalSlice)
            {
                returnString += n + " ";
            }

            returnString += "\n TopMask: ";
            foreach (int n in TopmMask)
            {
                returnString += n + " ";
            }
            returnString += "\n BottomMask: ";
            foreach (int n in BottomMask)
            {
                returnString += n + " ";
            }

            returnString += "\n leftMask: ";
            foreach (int n in LeftMask)
            {
                returnString += n + " ";
            }

            returnString += "\n rightMask: ";
            foreach (int n in RightMask)
            {
                returnString += n + " ";
            }




            return returnString;
        }


    }
}
